import os
import subprocess
from glob import glob

ui_files = glob(os.path.join('laadsOrderTool/ui', '*.ui'))
class_files = glob(os.path.join('laadsOrderTool', '*.py'))
target_file = 'laadsOrderTool/i1n/pyLOT_zh_CN.ts'
translations_qrc = 'laadsOrderTool/i1n/translations.qrc'
translations_rc = 'laadsOrderTool/i1n/translations_rc.py'

command = ['pyside6-lupdate'] + ui_files + class_files + ['-ts'] + [target_file]
subprocess.run(command)
subprocess.run(['pyside6-linguist', target_file])
subprocess.run(['pyside6-rcc', translations_qrc, '-o', translations_rc])
